#! usr/bin/perl -w 
use strict;

#this script filters hits at least 1kb long

my $file = shift @ARGV;
my $tmp = $file;
$tmp =~ s/\.tab$//;
my $output = "$tmp.filterd.tab";

open (DATA,  "<$file") || die "cannot open file $file: $!\n";
open(NEW, ">$output") || die "cannot open file $output: $!\n";

while(<DATA>)
{
	if (/^#/) { print NEW $_; }
	next if /^#/;
	my @row = split(/\s+/,$_);
	my $Align_len = $row[3];
	if($Align_len > 1000) { print NEW $_; }
}
